/* 
 * File:   BlinnPhongShader.h
 * Author: brady
 *
 * Created on February 8, 2011, 11:10 AM
 */
#include "LambertianShader.h"

#ifndef BLINNPHONGSHADER_H
#define	BLINNPHONGSHADER_H

class BlinnPhongShader : public LambertianShader {
public:
    BlinnPhongShader();
    BlinnPhongShader(double r, double g, double b, double sr, double sg, double sb);
    BlinnPhongShader(const BlinnPhongShader& orig);
    virtual ~BlinnPhongShader();
    Vector3D Shade(Ray &viewingRay, HitStruct& hitStruct, Scene* scene);
    void SetPhongExponent(double pe){PhongExponent = pe;}
    void SetSpecular(const Vector3D specular){this->SpecularColor = specular;}
    double GetPhongExponent(){return PhongExponent;}
    double GetMirrorCoefficient(){return MirrorCoefficient;}
    void SetMirrorCoefficient(double mc){MirrorCoefficient = mc;}
    void SetGlossValue(double gv){this->GlossValue = gv;}
    
    
protected:
    Vector3D ComputeReflections(Ray &hitRay, Vector3D &normal, Scene* scene);
    Vector3D ComputeHighlights(Ray &hitRay, Vector3D &normal, Scene* scene);
    Vector3D Bisect(Vector3D &v1, Vector3D &v2);
    Vector3D Reflect(Vector3D &normal, Ray& hitRay, int spp);
    double PhongExponent;
    double MirrorCoefficient;
    Vector3D SpecularColor;
    double GlossValue;
};

#endif	/* BLINNPHONGSHADER_H */

